package com.firefly.service.repository.mc;

import com.firefly.dao.dao.mc.mapper.McMenuMapper;
import com.firefly.dao.dao.mc.po.McMenuPo;
import com.firefly.dao.dao.mc.service.McMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description: 小程序用户权限菜单
 * @author: lzg(萤火科技 ： 854378082 @ qq.com)
 * @date: 2023/1/31
 **/
@Repository
public class McMenuRepository {
    private final McMenuService menuService;
    private final McMenuMapper menuMapper;
    @Autowired
    public McMenuRepository(McMenuService menuService, McMenuMapper menuMapper){
        this.menuService = menuService;
        this.menuMapper = menuMapper;
    }
    public boolean createMenu(McMenuPo entity){
        return menuService.save(entity);
    }
    public boolean updateByid(McMenuPo entity){
		return menuService.updateById(entity);
    }
    public List<Integer> getIds(Integer id){
        return menuMapper.getAllChildId(id);
    }
    public boolean removeId(List<Integer> ids){
        return menuService.removeByIds(ids);
    }
}
